package com.ruoyi.baseData.controller;

import com.ruoyi.baseData.domain.dto.ProceduresEquipmentConfigDto;
import com.ruoyi.baseData.domain.dto.ProceduresTeamDto;
import com.ruoyi.baseData.domain.dto.WoProceduresDto;
import com.ruoyi.baseData.service.ProceduresEquipmentConfigService;
import com.ruoyi.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/proceduresEquipmentConfig")
public class ProceduresEquipmentConfigController {

    @Autowired
    ProceduresEquipmentConfigService proceduresEquipmentConfigService;

    @PostMapping("/getProceduresEquipmentConfigByPage")
    public R export(@RequestBody ProceduresEquipmentConfigDto materialDto)
    {
        return R.ok(proceduresEquipmentConfigService.getProceduresEquipmentConfigByPage(materialDto));
    }

    @PostMapping("/addProceduresEquipmentConfigs")
    public R export(@RequestBody List<ProceduresEquipmentConfigDto> materialDto)
    {
        proceduresEquipmentConfigService.addProceduresEquipmentConfigs(materialDto);
        return R.ok("添加成功");
    }


    @PostMapping("/getEquipAndProceduresByWo")
    public R export(@RequestBody WoProceduresDto materialDto)
    {
        return R.ok(proceduresEquipmentConfigService.getEquipAndProceduresByWo(materialDto));
    }

}
